<?php
/**
 * Created by PhpStorm.
 * User: chenzhitao
 * Date: 2018/4/26
 * Time: 下午3:50
 */

namespace App\Busi\Modules\Auth;


use App\Busi\Modules\BaseBusi;
use App\Busi\Traits\UserTrait;
use App\Exceptions\ErrorCode\UserError;
use App\Exceptions\UserException;
use App\Http\Requests\CheckLoginRo;

class CheckLoginBusi extends BaseBusi
{
    use UserTrait;
    public function handle(CheckLoginRo $ro){
        $uid = $ro->uid;
        $user = $this->getUserByUid($uid);
        if(!$user){
            UserException::touch(UserError::XIAOAI_USER_NOT_EXIST);
        }
        return $this->checkUserLoginStatus($uid,$user['phone']);


    }

}